Pour identifier les départements concernés, on part de la France défnie as l’INSEE:
rgdal: version: 1.2-5, (SVN revision 648)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.1.2, released 2016/10/24
Path to GDAL shared files: /usr/local/share/gdal
Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491]
Path to PROJ.4 shared files: (autodetected)
Linking to sp version: 1.2-3
Checking rgeos availability: TRUE
La RGE compte 10 départements:
Soit 5196 communes. Les coordonnées sont indiquées en Lambert93 (conformes au JO). Il existe près de 5000 projections cartographiques. Deux sont utilsées en France:
Le fichier ght3 (spatialPolygonsDataFrame) permet de dessiner la RGE par commune, département ou GHT.
# superposition des GHT et départements
coul <- brewer.pal(n=12, name = "Set3")
plot(ght3, col = coul, axes = TRUE, main = "Superposition des GHT et départements")
b <- coordinates(ght3)
text(b, names(ght3), col = "red")
plot(dep2, border = "blue", add = TRUE)
# anciennes régions
# load("RGE-Description/ght3.Rdata")
load("ght3.Rdata")
ght3$ANC.REG <- NA
ght3$ANC.REG[ght3$CODE_DEPT == 67 | ght3$CODE_DEPT == 68] <- "ALSACE"
ght3$ANC.REG[ght3$CODE_DEPT == 54 | ght3$CODE_DEPT == 55 | ght3$CODE_DEPT == 57 | ght3$CODE_DEPT == 88] <- "LORRAINE"
ght3$ANC.REG[ght3$CODE_DEPT == '08' | ght3$CODE_DEPT == 10 | ght3$CODE_DEPT == 51 | ght3$CODE_DEPT == 52] <- "CHAMPAGNE-ARDENNE"
rge.anc.reg <- unionSpatialPolygons(ght3, IDs = ght3@data$ANC.REG)
plot(rge.anc.reg, axes = T, main = "Anciennes régions RGE")
load("../GHT/contour_departements.Rda") # dep2
load("../GHT/ght.Rda") # ght
x <- coordinates(ght[ght$STATUT == "Préfecture de département" | ght$STATUT == "Préfecture de région", "NOM_COM"])
y <- ght[ght$STATUT == "Préfecture de département" | ght$STATUT == "Préfecture de région", "NOM_COM"]
plot(dep2, axes = TRUE, main = "RGE - Préfectures")
points(x, col = "red", pch = 16)
text(x, as.character(y$NOM_COM), cex = 0.8, pos = 3)
# sous-préfecture
x <- coordinates(ght[ght$STATUT == "Sous-préfecture",])
y <- ght[ght$STATUT == "Sous-préfecture", "NOM_COM"]
plot(dep2, axes = TRUE, main = "RGE - Sous-Préfectures")
points(x, col = "blue", pch = 16)
text(x, as.character(y$NOM_COM), cex = 0.8, pos = 3)
# load("RGE-Description/ght3.Rdata")
load("ght3.Rdata")
# population par département
pop.dep <- tapply(ght3$POPULATION, factor(ght3$CODE_DEPT), sum)
pop.dep
08 10 51 52 54 55 57 67 68
280907 306581 569999 181521 731004 192094 1046873 1109460 758723
88
375226
# population par ght
pop.ght <- tapply(ght3$POPULATION, ght3$GHT, sum)
pop.ght
1 2 3 4 5 6 7 8 9
224185 551539 332951 114153 284520 801873 612150 375226 322407
10 11 12
1041847 408501 483036
# population totale
sum(pop.ght)
[1] 5552388
On récupère les fichiers correspondants dans le dossier /Users/jean-claudebartier/Documents/Resural/Stat Resural/RPU_Doc/RPU_Carto-Pop-Alsace/Cartographie/Structures_Urgence_FEDorU. Il y a 3 fichiers au format csv correspondant aux anciennes régions.
path = "/Users/jean-claudebartier/Documents/Resural/Stat Resural/RPU_Doc/RPU_Carto-Pop-Alsace/Cartographie/Structures_Urgence_FEDorU/"
a <- paste0(path, "Structures d'urgence_Als.csv")
b <- paste0(path, "Structures d'urgence_Lor.csv")
c <- paste0(path, "Structures d'urgence_CA.csv")
a2<-read.csv(a, skip = 1)
b2<-read.csv(b, skip = 1)
c2<-read.csv(c, skip = 1)
hopRge <- rbind(a2,b2,c2)
# On ne cnserve que les colonnes ayant un intéret. Les col. 12 et 13 contiennent latitude et longitude en WS84.
hopRge <- hopRge[, c(2,3,7,8,9,10,15,16,20,21)]
d2 <- hopRge
# on transforme mes virgules en points puis en numéric
d2$Longitude <- as.numeric(gsub(",",".", d2$Longitude))
d2$Latitude <- as.numeric(gsub(",",".", d2$Latitude))
coordinates(d2) = ~ Longitude + Latitude
proj4string(d2) = CRS("+proj=longlat +datum=WGS84")
# Reprojeter au format Lambert 93
# -------------------------------
# EPSG:2154 Lambert 93
newProj = CRS("+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
su_alca_L93 <- spTransform(d2, newProj)
plot(su_alca_L93, xlab = "Longitude", ylab = "Latitude", axes = TRUE, las = 1, main = "SU Région Grand Est (Lambert 93)" , pch = 16, col= "blue")
plot(dep2, add = TRUE)
x <- coordinates(su_alca_L93[su_alca_L93$Nom.établissement,])
y <- su_alca_L93[su_alca_L93$Nom.établissement,"Nom.établissement"]
text(x, as.character(y$Nom.établissement), cex = 0.5, pos = 3)